home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Present…nuary (Partner) - Disc 1 / The Apple Reference and Presentations Library (Disc 1)(January 1994).iso / Snow / US English / Atlantis / Atlantis™ Data-PPC / Atlantis™ Data Publisher / Atlantis™ Data Publisher.rsrc / HLP_132_RW 5 < prev    next >
Text File  |  1994-03-30  |  33KB  |  626 lines

  1.  tells the program which format to put the data 
  2.      in when printing.  The date field types include both the 
  3.      format to print and the format of the date in the data file.
  4.  
  5.      A    Alphanumeric.  This is used to define any Alphanumeric field, using upper-case characters only. 
  6.  
  7.      L    Lower Case.  This is the same as "Alpha" except that it will allow a lower case character as well as an upper case character.
  8.  
  9.      U    Used to shift all alphabetic characters to upper case before the field is printed.
  10.  
  11.      P    Telephone number.  Used to output in phone number format
  12.  
  13.      PE   Telephone number and extension.  
  14.  
  15.      G    GPS account number
  16.  
  17.      N    Number with commas (e.g. 2,000).
  18.           If the number is zero, then nothing is printed.
  19.           This is equivalent to Blank when Zero.
  20.  
  21.      N-   Signed number with commas (e.g. -2,000).
  22.           If the number if zero, then nothing is printed.
  23.  
  24.      #    Number with commas.
  25.           If the number is zero, then a 0 is printed.
  26.  
  27.      #-   Signed number with commas.
  28.           If the number is zero, then a 0 is printed.
  29.  
  30.      *    Number without commas (e.g. 2000).
  31.           If the number is zero, then nothing is printed.
  32.  
  33.      *-   Signed number without commas (e.g. -2000).
  34.           If the number is zero, then nothing is printed.
  35.  
  36.      @    Number without commas (e.g. 2000).
  37.           If the number is zero, then a 0 is printed.
  38.  
  39.      @-   Signed number without commas (e.g. -2000).
  40.           If the number is zero, then a 0 is printed.
  41.      
  42.      1-   Signed number with one decimal place (e.g. -100.0)
  43.  
  44.      2    Number with two decimal places (e.g. 100.00)
  45.      
  46.      2-   Signed number with two decimal places (e.g. -100.00)
  47.  
  48.      3    Number with three decimal places (e.g. 100.000)
  49.      
  50.      3-   Signed number with three decimal places (e.g. -100.000)
  51.  
  52.      4    Number with four decimal places (e.g. 100.0000)
  53.      
  54.      4-   Signed number with four decimal places (e.g. -100.0000)
  55.  
  56.      5    Number with five decimal places (e.g. 100.00000)
  57.      
  58.      5-   Signed number with five decimal places (e.g. -100.00000)
  59.  
  60.      6    Number with six decimal places (e.g. 100.000000)
  61.      6-   Signed number with six decimal places (e.g. -100.000000)
  62.  
  63.      7    Number with seven decimal places (e.g. 100.0000000)
  64.      
  65.      7-   Signed number with seven decimal places (e.g. -100.0000000)
  66.  
  67.      8    Number with eight decimal places (e.g. 100.00000000)
  68.      
  69.      8-   Signed number with eight decimal places (e.g. -100.00000000)
  70.  
  71.      9    Number with nine decimal places (e.g. 100.000000000)
  72.      
  73.      9-   Signed number with nine decimal places (e.g. -100.000000000)
  74.  
  75.      NOTE:  The preceding numeric field types from 1-9 always 
  76.      include commas and will print 0's after the decimal point if 0,
  77.      unless you use the .format field command.
  78.  
  79.      D    Date.  The first letter of a date field type is used as to indicate the output format.  D is the default date format supplied with the program (dd/mm/yy). 
  80.  
  81.           The second letter of the date format indicates the 
  82.           input (storage) format.
  83.  
  84.           Following are field types for the date formats:
  85.  
  86.           Da  mm/dd/yy          Db  ddlllyy           Dc  yynnn
  87.           Dd  yy/mm/dd          De  dd/mm/yy          Df  ddlllccyy
  88.           Dg  dd/mm/ccyy        Dh  ccyymmdd          Di  yymmdd
  89.           Dj  ccyynnn           Dk  mm/dd/ccyy        Dl  dd lll yy
  90.           Dm  dd lll ccyy       Dn  ll dd, yy         Do  lll dd, ccyy
  91.           Dp  dd.mm.yy          Dq  dd.mm.ccyy        Dr  mm.dd.yy
  92.           Ds  mm.dd.ccyy        Dt  jjjjjj*           Du  ddmmyy
  93.           Dv  ddoyy*            Dw  bitmap 1*         Dx  Send Sols jjjjjj
  94.           Dz  Elapsed (ZDAYS) jjjjjj                  DM  mmddyy
  95.  
  96.                mm     = month
  97.                dd     = day 
  98.                yy     = year
  99.                lll    = month literal
  100.                nnn    = year's julian date number
  101.                jjjjjj = julian date with one at January 1, 0000*
  102.                ccyy   = century, year
  103.  
  104.      AH   Hex Format.
  105.           This will allow you to output an alphanumeric field in hex format.
  106.  
  107.      T    Time stamp (HH:MM:SS)
  108.  
  109.      Q    Question.
  110.           This is the same as "Alpha" except that the program expects the field to contain only a Y or N.
  111. 
  112.      The field type entered will be one character, except in the case of dates, hex and negative numbers.  The second character can be a minus sign (-) in the case of negative numbers.  Comp-3's always have a "-".   Any other usage of negative numbers depends upon your application.
  113.  
  114. * Section *
  115. 17.5.1  Julian Date Notes
  116.  
  117.      The date type Dt is described above as the Julian date starting at January 1, 0000.  When using this date type for elapsed 'Julian' days since a given date, such as January 1, 1900, this does work for display, since only the century is different, but does not work for selection criteria or in calculations.  
  118.  
  119.      The date type Dz can be used.  This is defined as the elapsed days since a given date.  The default starting date is January 1, 1900, but may be changed by the user.  When a Dz field is first encountered, Atlantis™ Data Publisher looks for a ZDAYS.DAT file.  The ZDAYS.DAT file contains the Julian date for the beginning of the elapsed days count.  For example, January 1, 1900 is Julian date 693975 and January 1, 1980 is Julian date 723195.  This starting Julian date for elapsed days is put in the ZDAYS.DAT file, using any ASCII text editor (do not put any commas in the number).  An example of ZDAYS.DAT file is included in the pgms folder.
  120.  
  121. * Section *
  122. 17.5.2  Single Digit Month Date Format (ddoyy-)
  123.  
  124.      The ddoyy date format allows for the single-digit month.  The date is stored as 5-digit signed number.  This number is interpreted as follows:
  125.  
  126.         - The leftmost 2 digits equal the day of the month.
  127.         - The rightmost 2 digits equal the year, assuming that 00 is 1900.
  128.         -  The middle digit is always a number from 1 to 6.  When the number is positive the month is equal to the middle digit.  
  129.  
  130.       When the number is negative than the month is equal to the middle digit + 6.
  131.  
  132.       Examples:
  133.                13588  is May 13, 1988   
  134.                     The day is 13
  135.                     The year is 1900 + 88 = 1988
  136.                     The month is 5, since 13588 is positive.
  137.  
  138.                -13588 is November 13, 1988
  139.                     The day is 13The year is 1900 + 88 = 1988
  140.                     The month is 5 + 6 = 11, since -13588 is negative.
  141.  
  142. * Section *
  143. 17.5.3  Bit Mapped Format
  144.  
  145.      The date format of w allows for a date that is bitmapped into a two-byte unsigned number.   
  146.  
  147.      The five least significant bits (B0 through B4) equal the day of the month.  The next four bits (B5 through B8) are the month.  The 7 most significant bits (B9 through B15) are the year. 
  148.  
  149.           Example:
  150.                Consider the decimal number 45,298:
  151.                In hexadecimal it is B0F2.
  152.                This translates into binary form as:
  153.                                              
  154.                       B      0        F         2
  155.  
  156.                      1011   0000     1111      0010
  157.             
  158.                The day of the month is equal to the 5 least significant bits or the first 5 from the right. This gives the number:
  159.  
  160.                     10010 in binary =
  161.                     18 in decimal,
  162.                     therefore the day of the month is 18.
  163.          
  164.                The next 4 bits from the right represent the month. This gives us the number:          
  165.  
  166.                     0111 in binary =
  167.                     7 in decimal,
  168.                     therefore the month is 7 or July.
  169.  
  170.                The 7 most significant bits or the first 7 from the left represent the year assuming that 0 is 1900.  This yields the number:
  171.                     1011000 in binary = 
  172.                     88 in decimal,
  173.                     therefore the year is 1900 + 88 = 1988.
  174.  
  175.                This gives us the date July 18, 1988.
  176. * Section *
  177. 17.6  Max Number of Char
  178.  
  179.      Enter the maximum size of the field.  This is the maximum number of characters that are allowed in the field.
  180.  
  181.      When defining numeric fields, allow for integers, decimal points and commas (if not implied or hidden).  Do not allow for commas or for numbers after the decimal point.  Also, do not allow for commas which are to be printed (as specified at Field Type), but which are not part of the field value itself.
  182.  
  183.      Note:  In the case of C-Basic variable length fields, enter the maximum number of characters possible for the field.  For variations on this, refer to Defining or Re-Defining Portions of a Field and Splitting Fields, both covered later in this chapter after Field Start Location.
  184.  
  185. * Section *
  186. 17.7  Format of Data in File
  187.  
  188.      Select from the list one of the following codes to indicate how the field's data is stored.  This code tells the program what kind of translation to do on the data when it reads it (if any).  Leave blank if the field has no special storage format.  If you are unsure, check your application's documentation.
  189.  
  190. 
  191.        (Blank) Normal Display Formats.  (No change of format required)  
  192.                This can be used for regular alpha and numeric fields.
  193.  
  194.           0    COBOL COMP (BCD: 0 to 9 and OD means negative)
  195.  
  196.           1    COBOL COMP-1 (Same as Short Integer)
  197.  
  198.           3    COBOL COMP-3 (signed compressed BCD number)
  199.  
  200.           4    4-byte integer (Tandy Basic)
  201.  
  202.           6    COBOL COMP-6 (unsigned compressed BCD number)
  203.  
  204.           8    8-byte integer (Tandy Basic)
  205.  
  206.           ^    DataFlex numerics and dates
  207.  
  208.           !    Basic Single Precision (MicroSoft and IBM Basic)
  209.                   (4 byte internal size)
  210.  
  211.           #    Basic Double Precision (MicroSoft and IBM Basic)
  212.                   (8 byte internal size)
  213.           
  214.           %    2 byte integer (same as Short Integer)
  215.  
  216.           &    2 byte integer (same as % format, except 
  217.                     reverses order of numbers)
  218.  
  219.           >    MicroSoft Fortran Double Decimal Number (8 bytes)
  220.  
  221.           <    MicroSoft Fortran Single Decimal Number (4 bytes)
  222.  
  223.           A    ASCII character (0 to 255 value)
  224.  
  225.           B    Signed byte (-128 to 127 value)
  226.  
  227.           C    Combined sign on last display-format digit
  228.                     (Micro Focus default)
  229.  
  230.           D    Floating point number (double precision)
  231.  
  232.           E    COBOL COMP-4 Two's complement binary number
  233.  
  234.           F    Floating point number (single precision)
  235.  
  236.           G    BCD packed numbers
  237.  
  238.           H    Informix Small Integer
  239.  
  240.           I    Short Integer (-32768 to 32767 value)
  241.  
  242.           L    Long Integer
  243.  
  244.           M    Informix Double "Money"
  245.  
  246.           N    Null terminated strings - fixed length fields, strings 
  247.                  less than the maximum field size are terminated with a null
  248.  
  249.           P    Lattice C-Food packed number
  250.  
  251.           R    Turbo Pascal 6-byte real numbers
  252.  
  253.           S    Separate Sign (same as blank)
  254.  
  255.           T    Time stamp (MSDOS FCB form)
  256.  
  257.           U    Unsigned short Integer (0 to 65535 values)
  258.  
  259.           V    Micro Focus COBOL Comp format
  260.  
  261.           W    Realia Comp-4 S9(9)
  262.  
  263.           X    Realia Comp-4 S9(18)
  264.  
  265.           Y    Date stamp (MSDOS FCB form)
  266.  
  267.           Z    Realia Comp-5 S9(18)
  268.  
  269. 
  270.  
  271. * Section *
  272. 17.7.1  Notes on COBOL Formats
  273.  
  274. COMP.  (Computational)  The value is stored as a binary number, rather than as an ASCII digit, one byte per digit.  If a sign is specified and if there is a negative code at the trailing byte, computational items are treated as negative.  A hexadecimal "0D" is treated as negative.  All other values are treated as positive.
  275.  
  276. COMP-1.  This is a signed, 2-byte binary number.  Regardless of how many decimal places are in this field, it remains 2 bytes unless this field is on the receiving end of an operand.  The value of a Comp-1 item ranges between -32768 to +32767.
  277.  
  278. COMP-3.  This is sometimes referred to as a packed decimal or Binary Coded Decimal (BCD).  Data items that are Comp-3 are allocated memory at one-half character position for each numeral, plus an extra half position for the sign whether specified or not.  The half position for the sign is "0D" for negative.  Anything else is treated as positive.  If the number of decimal places is even, it is treated as if there is another decimal place at the beginning of the field.
  279.  
  280.      Comp-3's are always signed and should have a "-" as the second character when defining the Field Type above.
  281.  
  282.      To calculate the physical size in a record of a Comp-3 field, add up all the digits specified, add one for a sign (whether one is specified or not), divide by two and round up.
  283.  
  284.      Following is an example of calculating start location with COBOL source code:
  285.  
  286. 
  287.           Type       Size    Decimal    Location     Picture
  288.  
  289.           Alpha       10                    1       PIC X(10)
  290.           Comp-3      05       3           11       PIC 9(5)V999
  291.           Alpha       05                   16       PIC X(5)
  292.  
  293.                       20 = Record Size
  294. 
  295.  
  296.      The above was calculated as follows:
  297.  
  298.      1.   To get the next field starting location, add the previous field's size and starting location, 10 (field size) plus 1 (starting location) = 11.
  299.  
  300.      2.   The Comp-3 size was computed as follows:  Add 5 plus 4 (include the sign as it does take up space) and you have 9, divide 9 by 2 and you have 4.5, round up 4.5 and you have 5.  You round up to fit the "uneven byte".
  301.  
  302.      3.   Now add 5 plus 11.  Your starting location for the next field is 16.
  303.  
  304.                Example:  In the Comp-3 format +1234 (in hex) would look like this:
  305.           
  306.                               | 0 1 | 2 3 | 4 C |
  307.                         byte    1     2     3
  308.           
  309.  
  310. COMP-6.  This is the same as Comp-3 except that there is no sign allocation, even if an "S" is specified.  If the number of decimal places is odd, it is treated as though there was an extra decimal place at the beginning of the field.  Thus, an S999 is the same size as 9999 or S9999.  This is also known as a packed field.
  311.  
  312. S.  This is used when the byte is stored in "display" format, such as ASCII characters, rather than binary values, and the sign is a separate character.  This is also used when the number is stored in a display format.
  313.  
  314. C.  This is used for the trailing sign, combined with the last decimal number.  This is the usual default for MF Cobol.
  315.  
  316.           Example:  The chart on the next page shows what the values of the signed numbers are.  For example, the value of 012r would be "-122".
  317.           
  318.                Associated       Sign Positive Character
  319.                                      Value Is
  320.  
  321.                  Digit         Positive (+) Negative (-)
  322.                _________________________________________
  323.  
  324.                    0              (   0       )   p
  325.                    1              A   1       J   q
  326.                    2              B   2       K   r
  327.                    3              C   3       L   s
  328.                    4              D   4       M   t
  329.                    5              E   5       N   u                        
  330.                    6              F   6       O   v
  331.                    7              G   7       P   w
  332.                    8              H   8       Q   x
  333.                    9              I   9       R   y
  334.           
  335.  
  336. * Section *
  337. 17.7.2  Basic Formats
  338.  
  339.      !    This is for Micro Soft Basic and IBM Basic, to signify the single precision number whose size is four bytes floating decimal point format.
  340.  
  341.      #    This is for MS Basic and IBM Basic, to signify the double precision number whose size is 8 bytes floating decimal point format. 
  342.  
  343.      %    The 2-byte integer.  The bytes are internally stored in reverse order on the IBM.  
  344.  
  345.                Example:
  346. 
  347.                Byte   Byte
  348.                 01     02   = 201
  349.                          2-Byte word
  350. 
  351.  
  352. * Section *
  353. 17.7.3  Dataflex Formats
  354.  
  355.      ^    DataFlex numeric and date formats.  The Max Number of Char above is the DataFlex field Len times 2, minus the number of decimal points.  
  356.  
  357.           Define DataFlex Julian dates as follows:
  358.      
  359.           Max Number of Char         6
  360.           Field Type                 *
  361.           Format of Data in File     ^
  362.      
  363.           When using the date field for a report, select the date field, and then the option for converting the date.  If your Julian date is based on January 1, 0, then use that selection.  Fore more details on Julian Dates and mathematical calculations, refer to Chapter 14.
  364.  
  365. * Section *
  366. 17.8  Field Number in Record
  367.  
  368.      Enter either a Field Number in Record or a Field Start Location (next entry), depending on your file type.  In some cases, you can enter both.  See Defining or Re-Defining Portions of a Field for details.
  369.  
  370.      If your field locations are relative numbers (e.g. 1, 2, 3) rather than byte locations, then enter the relative field number here.  This is used for the file types of C-Basic and Open Systems SMC Basic.  It is also used for some spreadsheets, such as Lotus 123, where each column is assigned a field number, from left to right.
  371.  
  372. * Section *
  373. 17.9  Field Start Location
  374.  
  375.      Enter the byte location of the first character of the field (unless you entered a field number).  Record byte locations start at one.
  376.      
  377.           Example:    1 2 3 4 5 6 7 8 9 10 11 12
  378.  
  379.                       J O N E S       B U D
  380.      
  381.      In the above example, the first field (last name) takes up eight bytes.  The next field (first name) takes up four bytes.  The start location is 1 for the first field and 9 for the second field.  Some computer systems have hidden fields or hidden bytes.  For instance, MicroSoft Cobol Indexed Files have three hidden bytes at the beginning of each record.  In that case, the first field starts at byte 4.
  382.  
  383.      The size calculation for some fields is not always straightforward.  For example, the numeric COBOL Comp formats are stored in compressed form.  (See Format of Data in File.)
  384.  
  385. * Section *
  386. 17.10  Defining or Re-Defining Portions of a Field
  387.  
  388.      It is possible to re-define a portion of a field which has already been defined.  This is done by entering both a Field Start Location and a Field Number in Record.  Depending on your file type, there are two methods of doing this, as follows.
  389.  
  390. * Section *
  391. 17.10.1  Splitting Fields in C-Basic and Open Systems Files
  392.  
  393.      For these file types, the fields are defined using a relative field number (Field Number in Record), rather than a fixed byte location (Field Start Location).  These fields are separated by a delimiter, such as a comma.  The field lengths may be variable, but are separated by a comma or other delimiter so that the program knows when the next field starts.  Enter the decimal ASCII value of the delimiter under the Field Separator Value on the previous screen, if the separator is not a comma.
  394.  
  395.      To define a portion of one of these fields, you would still enter the relative field number at Field Number in Record.  In addition, on the same screen enter the byte position in that field that marks the start of new field definition.  
  396.  
  397.      Below is an example:
  398.      
  399.                      Field No in Record             Field 1 = Name
  400.                        1      2      3              Field 2 = Age
  401.                                                     Field 3 = Birthdate
  402.      Record #1      John Jones,32,120154
  403.      Record #2      Sally Swanson,32,121254
  404. 
  405.      You want to define the last two digits of Field #3 to get just the year, not a full date.  Define another field as:
  406.           
  407.           Field Number in Record      3    (Is a portion of Field #3)Field Start Location        5    (Starts at Location 5 of Field #3)  
  408.           Maximum Number of Char      2    (You want two characters)
  409.      
  410.  
  411. * Section *
  412. 17.10.2  Splitting Fields, All Other File Types
  413.  
  414.      Other file types have byte numbers indicating a fixed starting location of a field.  Each new field will always start at that byte number.  These fields are defined using the Start Location of Field, rather than Field Number in Record.  
  415.  
  416.      If your field contains only one type of value, and has no comma delimiters within the fixed length field, then to specify a portion of that field, determine the starting byte position that you need.  Enter that byte position as the Field Start Location, and always 0 as the field number in record.
  417.      
  418.      Following is an example of a date field being split, to separate just the year in the last two digits.
  419. 
  420.      Start Location     = 20
  421.      Max Number of Char = 6 
  422.  
  423.                                 X X X X X X        
  424.                         Byte # 20         25 
  425.                                                 
  426.      To define a new field which contains only the last two digits of this field, enter the following:
  427.           
  428.      Start Location     = 24
  429.      Max Number of Char = 2
  430.      Field No in Record = 0
  431.      
  432.  
  433. * Section *
  434. 17.11  Fixed Length Field Containing Comma-delimiters
  435.  
  436.      As another type of field format, you may have a large fixed-length field which contains several sections, and these sections may be separated by comma delimiters.  The full field itself would still be fixed length, but the sections within the field would be variable length and separated by a comma (or other delimiter).  If the full fixed length is not used, space is left before the start of the next field (which also starts at a fixed position).  In this instance, you would also indicate both the field number in record and the field starting location.
  437.  
  438.      As an example, you could have a field which contains the city, state and zip code for a person.  These are separated by commas.  In order to define just the city or the state or the zip, you can not indicate a field starting location, as these are variable length entries (within a fixed length field).
  439.  
  440.      You must still specify the Field Start Location, as the start of the full field.  Then you must also enter, on the same screen, a field number in record.  This field number indicates which field to look for in that large field.
  441.  
  442.      For our example, the full field may be 20 bytes and may start at byte position #25 in the record.  If you want to define just the zip code, enter the starting location for the 20-byte field (25).  Then enter the Field Number in Record as 3, as it is the third field within that field.
  443.      
  444.      Start
  445.      location = 25 
  446.                  X X X X X X X X X X X X X X X X X X X X
  447.                  <------ Maximum Field Size = 20 ------>    
  448.  
  449.                  The field could contain three sections, e.g.
  450.                    City,         State,         Zip
  451.  
  452.                  X X X X X , X X X X X X X , X X X X X   
  453.                  X X X X X X , X X X X X X X , X X X X X
  454.                  X X X , X X X X X X , X X X X X 
  455.      
  456.  
  457.      The start location is byte #25.  The field has three sections within it, which are separated by commas.  
  458.      
  459.      These sections could be defined as follows:
  460.      
  461.  
  462.           City       Start Location          25  (Start location of full field)
  463.                      Field No in Record       1  (Is first section of field)
  464.                      Max Number of Char      20  (Same as Max for full field)
  465.  
  466.           State      Start Location          25  (Start location of full field)
  467.                      Field No in Record       2  (Is second section of field)
  468.                      Max Number of Char      20  (Same as Max for full field)
  469.  
  470.           Zip        Start Location          25  (Start location of full field)
  471.                      Field No in Record       3  (Is third section of field)
  472.                      Max Number of Char      20  (Same as Max for full field)
  473.  
  474.      
  475.  
  476. * Section *
  477. 17.12  Fields with a Leading Length Byte
  478.  
  479.      Your file may be set up in such a way that you have a block of fields, in which the block (of fields) has a fixed length, but each of the fields in the block has a variable length, and has a 'leading length byte' which gives the length of that field.  Following is an example:
  480. 
  481.                              Field 1   Field 2     Field 3     Field 4
  482.  
  483.      Leading Length Byte --> 4 J O H N 5 S M I T H 5 H O M E R 2 A K
  484.      & Field Values
  485.                                                1 1 1 1 1 1 1 1 1 1 2    
  486.      Location in Record  --> 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
  487. 
  488.      In the preceding example, there is one byte before each field value which indicates the length of that field for that particular record.  These numbers will vary from record to record, depending on the values within each field.  
  489.  
  490.      The Field Start Location for each of these fields will be the byte position of the first field in the block.  This is a fixed starting location in the record.
  491.  
  492.      Each of these fields will then also have a relative Field Number in Record, starting with 1 for the first field in the block, 2 for the second field in the block, and so forth.  The Max Number of Char for each of these fields is used in the normal fashion and is set to the maximum number of characters that each field can be.
  493.  
  494.      The above example may be defined as follows:
  495.      
  496.  
  497. Field Separator Value (first screen)     999
  498.  
  499. First Name      Start Location           1  (Start location of block)
  500.                 Field No in Record       1  (Is first field of block)
  501.                 Max Number of Char      10  (First name can be up to 10 char)
  502.  
  503. Last Name       Start Location           1  (Start location of block)
  504.                 Field No in Record       2  (Is second field of block)
  505.                 Max Number of Char      15  (Last name can be up to 15 char) 
  506.  
  507. City            Start Location           1  (Start location of block)
  508.                 Field No in Record       3  (Is third field of block
  509.                 Max Number of Char      15  (City can be up to 15 char)
  510.  
  511. State           Start Location           1  (Start location of full field)
  512.                 Field No in Record       4  (Is third section of field)
  513.                 Max Number of Char       2  (State can be only 2 char)
  514.      
  515.  
  516. * Section *
  517. 17.13  Saving the Field Definition
  518.  
  519.      Click OK to save the field definition.  You can now define another field(s) if needed, or you may start designing reports.
  520.  
  521. * Section *
  522. 17.14  Changing Field Definitions
  523.  
  524.      Select Define Files from the Dictionary menu.  Select the file name from the list, and click OK to file that definition.  The field definition screen will appear.  Select the field from the list and make changes.  Click OK to save the changes.
  525.  
  526. * Section *
  527. 17.15  Deleting Field Definitions
  528.  
  529.      Select Define Files from the Dictionary menu.  Select the file name and then the field name and click on Delete.
  530.  
  531.  
  532. * Chapter *
  533. * Section *
  534. 18.1  File Relationships
  535.  
  536.      A file relationship must be defined in order to combine data from two or more files into a single report.  The second file is included by selecting Special Commands and Choose Field from Another File while in the design.  If there are no files listed in the box, then define the relationship.  
  537.  
  538.      To start, select Relationship Definitions from the Definitions Menu.  This chapter covers the types of file relationships available and how to define each.  
  539.  
  540.      This information in this chapter includes:
  541.  
  542.           - what a key field is
  543.           - the types of file look-ups
  544.           - how to enter the file relationship
  545.           - how to use file relationships in your report design
  546.           - the mathematical results from some look-ups
  547.  
  548.      There are many things which can be known about file look-ups.  This chapter starts with a general overview of how to enter a File Relationship, and then detailed information on each type of look-up is given.  See your dealer for an overview of your application's data files, if available.  There may be a Data Dictionary (inculding File Relationships) already in existence.
  549.  
  550. * Section *
  551. 18.1.1  Name of First File
  552.  
  553.      The first file is the file which will be doing the looking up.  If running a report, it is the file first selected when creating the design.  There must be a field in this first file which matches a key field in the file being looked up.  (See the section on Key Fields, later in this chapter.)  Enter the name of the file as it was defined for use with the Report Writer, not necessarily the name of file on disk.  You do not need to enter a folder or directory name.
  554.  
  555.           Example: custdat
  556.  
  557. * Section *
  558. 18.1.2  Name of Lookup File
  559.  
  560.      Enter the name of the file from which you are going to draw the additional data.  
  561.  
  562.      For example, you may have a report which starts with the customer sales file, and you need to look up the address in the mailing list file.  The first file would be the sales file, and the lookup file would be the mailing list file.  A field in the customer file (eg. customer name) would need to match a field in the mailing list file in order for the lookup occur.
  563.  
  564.           Example:  maillist
  565.  
  566. * Section *
  567. 18.1.3  Lookup Specification
  568.  
  569.      Here enter the field from the first file which matches the key in the second file, followed by the lookup symbol.  The symbols and types of lookups available are detailed in the following sections.  For the example above, a many-to-one relationship would probably exist, that is many sales for each customer.  The symbol for a many-to-one relationship is ->, so that would be used in the lookup specification.
  570.  
  571.           Example:  customer name->
  572.  
  573. * Section *
  574. 18.1.4  Which Key to Use
  575.  
  576.      Here enter the key number of the key field.  This needs to match the key number included in the file definition for the looked up file, and if you do not have key fields defined, then you need to go back to that file definition and enter the starting location of the key fields on the file definition.  If you have only one key field, use 1.
  577.  
  578.           Example:  1
  579.  
  580. * Section *
  581. 18.1.5  Type of Relationship
  582.  
  583.      Enter the type of relationship which exists between the two files.  Types of file relationships available are:
  584. 
  585.      Keyed Read                        field 1 -> field 2Keyed Read based on Native Index  field 1 ->> field 2 
  586.  
  587.      One-to-Many Keyed Read            field 1 +> field 2
  588.      Based on Native Index             field 1 +>> field 2
  589.      One-to-Many Keyed Read Chain      field 1 +> field 2 +> field 3
  590.  
  591.      Direct Read                       field 1 => field 2 or "n" => field 2
  592.      One-to-Many Direct Read Chain     field 1 *> field 2 *> field 3
  593. 
  594.  
  595.      Enter the symbol for the type of relationship that exists.  For the example above, use ->, the keyed read lookup.
  596.  
  597.      Click OK to save the file relationship.  You can go back to a design which uses the First File as the main file for your design, and you can select Special Commands and Field from Another File to see the file defined here in the list box.
  598.  
  599.      Following are sections on each type of lookup.  You may not need to read every page of this chapter in order to define relationships and combine files in report!
  600.  
  601. * Section *
  602. 18.2  Keyed Read Look-ups
  603.  
  604.      A keyed read is done by matching the look-up field with the key field of the file being looked up.  Here are some definitions:
  605.  
  606.           The Lookup Field.  This is a field in the primary data file used for the report which matches the key field of      file being looked up.  
  607.  
  608.           It is used for when entering the look-up specification on the file relationship.
  609.  
  610.           Key Field.  This is the field of the looked up file which contains the key data.  Its entries are unique (e.g. account number).  The contents of the Lookup Field will match the contents of the Key Field.  
  611.  
  612.           The Key Field is not entered on the look-up specification on the file relationship menu, but it is used internally by the program to locate looked-up field.
  613.  
  614.           Looked up Field.  This is the field that is "looked up" by the program and included in the report.  This field is the one selected when designing the report.  It is not entered on the File Relationships menu (unless it is also part of the specification).
  615.  
  616. * Section *
  617. 18.2.1  The Keyed Read Lookup Specification
  618.  
  619.      This is the format for a keyed read look-up specification:
  620.  
  621.      (File 1)                   (File 2)
  622.    LOOKUP FIELD               LOOKED UP FIELD       .key[n]    
  623.   (Matches key field    ->   (Field to include      (Number of keyof looked up file)           in Report             being used)
  624. 
  625.  
  626.      The field which matches the key field is on the left side of the